package com.geekarchitect.patterns.visitor.geek;

import com.geekarchitect.patterns.visitor.geek.v4.*;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Hongliang Zhu
 * @create 2023-01-07 21:44
 */
public class ToolApplication4 {

    public static void main(String[] args) {
        List<ResourceFile> resourceFiles = listAllFiles("/");
        for (ResourceFile file : resourceFiles) {
            Extractor extractor = ExtractorFactory.getExtractor(file.getType());
            extractor.extract2txt(file);
        }

    }


    private static List<ResourceFile> listAllFiles(String dir) {
        List<ResourceFile> list = new ArrayList<>();
        list.add(new PPTFile("a.pdf"));
        list.add(new WordFile("b.word"));
        list.add(new PdfFile("c.pdf"));
        return list;

    }
}
